package com.chenshu.mybatis_demo.mapper;

import com.chenshu.mybatis_demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-04-16
 * Time：00:15
 */
@Mapper
public interface ArticleMapper {
    public int add(@Param("article") ArticleInfo articleInfo);
    public int addAndGetId(ArticleInfo articleInfo);

    public int delById(Integer id);

    public int updateTitle(@Param("title") String title, @Param("id") Integer id);

    public List<ArticleInfo> sortArticle(@Param("sort") String sort);

    public List<ArticleInfo> searchArticle(@Param("title") String title);

    public List<ArticleInfo> getAll();

    public List<ArticleInfo> selectByCondition(ArticleInfo articleInfo);

    public int deleteByIds(@Param("ids") List<Integer> ids);
}
